﻿using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Office.Interop.Word;

namespace WFL.Office.Word
{
    public class WordInlineShapes
    {
        public WordInlineShape this[int index]
        {
            get { return new WordInlineShape(_inlineShapes[index]) { Document = Document }; }
        }

        private InlineShapes _inlineShapes;

        public int Count
        {
            get { return _inlineShapes.Count; }
        }

        public WordDocument Document
        {
            get;
            internal set;
        }

        internal WordInlineShapes(InlineShapes inlineShapes)
        {
            _inlineShapes = inlineShapes;
        }

        public WordInlineShape AddPicture(string fileName, bool linkToFile, bool saveWithDocument, WordRange range)
        {
            object rangeArg = range != null ? range._range : Type.Missing;
            InlineShape inlineShape = _inlineShapes.AddPicture(fileName, linkToFile, saveWithDocument, ref rangeArg);
            return new WordInlineShape(inlineShape) { Document = Document };
        }
    }
}
